﻿CREATE TABLE [dbo].[TimeDim]
(
	[Time] DATETIME NOT NULL, 
    [Year] SMALLINT NOT NULL, 
    [Month] INT NOT NULL, 
    [MonthOfYear] SMALLINT NOT NULL, 
    [Day] INT NOT NULL, 
    [DayOfMonth] SMALLINT NOT NULL, 
    [Hour] INT NOT NULL, 
    [Minute] BIGINT NOT NULL PRIMARY KEY, 
    [MonthName] NVARCHAR(50) NOT NULL, 
    [DayName] NVARCHAR(50) NOT NULL, 
    [MonthOfYearName] NVARCHAR(50) NOT NULL, 
    [HourName] NVARCHAR(50) NOT NULL, 
    [MinuteName] NVARCHAR(50) NOT NULL
)

GO

CREATE INDEX [IX_TimeDim_Time] ON [dbo].[TimeDim] ([Time])
